package gui.messagebox;

import gui.GUIHandler;
import gui.GUIManager;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.Window.Type;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Dialog.ModalityType;
import javax.swing.JTextField;

import config.LauncherHelper;

import room.Room;
import tournament.Tournament;
import tournament.TournamentLayoutPanel;
import javax.swing.JScrollPane;

public class TournamentLayoutDialog extends JDialog {

	private final JPanel contentPanel = new JPanel();
	public Tournament tournament;

	/**
	 * Launch the application.
	 */
	public static void main(Tournament args) {
		try {
			TournamentLayoutDialog dialog = new TournamentLayoutDialog(args);
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public TournamentLayoutDialog(Tournament tournament) {
		setType(Type.POPUP);
		setTitle("Tournament");
		setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 849, 548);
		getContentPane().setLayout(new BorderLayout());
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
	
		contentPanel.setLayout(new BorderLayout());
		{
			JScrollPane scrollPane = new JScrollPane();
			scrollPane.setBounds(0, 0, 833, 477);
			contentPanel.add(scrollPane, BorderLayout.CENTER);
			
			{
				TournamentLayoutPanel panel = new TournamentLayoutPanel(tournament);
				scrollPane.setViewportView(panel);
			}
		}
		final TournamentLayoutDialog me = this;
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				
				JButton btnConfirm = new JButton("Cancel");
				btnConfirm.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						me.dispose();
					}
				});
				btnConfirm.setActionCommand("OK");
				buttonPane.add(btnConfirm);
			}
		}
	}
}
